package com.cc.common.model

import java.io.File
import java.security.MessageDigest

/**
 * @author cc
 * @since 2024/3/17
 * @version 1.0
 */

val uploadDir = userDir() + File.separator + "upload" + File.separator
fun userDir(): String {
    return System.getProperty("user.dir")
}

@OptIn(ExperimentalStdlibApi::class)
fun String.md5(): String {
    val md = MessageDigest.getInstance("MD5")
    val digest = md.digest(this.toByteArray())
    return digest.toHexString()
}



